package cn.com.bdqn.dao;

import cn.com.bdqn.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrdersDao {

    @Select("select * from orders where odr_customer = #{value}")
    public List<Orders> queryByOdrCustomer(String odrCustomer);

    @Select("select * from orders where odr_code = #{value}")
    public Orders queryByOdrCode(String odrCode);

    //查询最近下单的时间
    @Select("select odr_date from orders \n" +
            "where odr_cust_no = #{value}\n" +
            "order by odr_date desc\n" +
            "limit 1")
    String queryRecentDate(String id);
}
